package com.alibaba.dubbo.remoting.interceptor;

import java.net.InetAddress;
import java.util.Map;

import com.alibaba.dubbo.common.inet.InetAddressMatcher;
import com.alibaba.dubbo.remoting.Interceptor;
import com.alibaba.dubbo.remoting.RemoteCalling;
import com.alibaba.dubbo.remoting.buffer.ChannelBufferInputStream;

/**
 * 抽象的黑名单
 * @author Administrator
 *
 */
public abstract class BlackListInterceptor implements Interceptor, InetAddressMatcher {

	@Override
	public boolean acceptAfterConnected(InetAddress remoteAddress) {
		return !match(remoteAddress);
	}
	
	@Override
	public boolean acceptAfterDecodeHeader(InetAddress remoteAddress, Map<String, String> attachments, int data) {
		return true;
	}
	
	@Override
	public boolean acceptAfterDecodeBody(InetAddress remoteAddress, Map<String, String> headers, RemoteCalling calling) {
		return true;
	}

	@Override
	public boolean acceptAfterHead(InetAddress remoteAddress, int total, int body) {
		return true;
	}
	
	@Override
	public boolean acceptBeforeEncodeBody(InetAddress remoteAddress, Map<String, String> headers) {
		return true;
	}
	
	@Override
	public boolean acceptBeforeEncodeHeader(InetAddress remoteAddress, Map<String, String> attachments) {
		return true;
	}

	@Override
	public InetAddress select(InetAddress[] addresses) {
		return null;
	}
	
	
}
